const express = require('express');
const app = express();


//配置导入cors中间件
const cors = require('cors');
app.use(cors());

//配置解析表单数据中间件，解析x-www数据
app.use(express.urlencoded({extended:false}));

//导入并使用用户路由模块
const userRouter = require('./router/user');
app.use('/api',userRouter);

//导入并使用用户收藏路由模块
const collectedRouter = require('./router/collected');
app.use('/api',collectedRouter);

//导入并使用公司路由
const companyRouter = require('./router/company');
app.use('/api',companyRouter);

app.listen(2020,()=>{
    console.log('api_server is running');
})